from flask import Flask, request
from query_backend import main

app = Flask(__name__,
            static_folder='node_modules')


@app.route("/")
def main_page():
    mp = open("index.html", "r")
    return mp


# POST method
@app.route("/search", methods=["POST"])
def search():
    search_param = request.form["question"]
    kg = main.KgDemo()
    answer = kg.main(search_param)
    return answer
